package ProjetCorba;

/**
 * Interface definition : Transporteur
 * 
 * @author OpenORB Compiler
 */
public abstract class TransporteurPOA extends org.omg.PortableServer.Servant
        implements TransporteurOperations, org.omg.CORBA.portable.InvokeHandler
{
    public Transporteur _this()
    {
        return TransporteurHelper.narrow(_this_object());
    }

    public Transporteur _this(org.omg.CORBA.ORB orb)
    {
        return TransporteurHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:ProjetCorba/Transporteur:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        if (opName.equals("_get_numTra")) {
                return _invoke__get_numTra(_is, handler);
        } else if (opName.equals("deposerColis")) {
                return _invoke_deposerColis(_is, handler);
        } else if (opName.equals("notifierTra")) {
                return _invoke_notifierTra(_is, handler);
        } else if (opName.equals("payer")) {
                return _invoke_payer(_is, handler);
        } else if (opName.equals("retraitColis")) {
                return _invoke_retraitColis(_is, handler);
        } else if (opName.equals("selectionnerColisTra")) {
                return _invoke_selectionnerColisTra(_is, handler);
        } else if (opName.equals("transporterColis")) {
                return _invoke_transporterColis(_is, handler);
        } else {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke__get_numTra(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg = numTra();
        _output = handler.createReply();
        _output.write_short(arg);
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_retraitColis(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg0_in = _is.read_short();

        try
        {
            retraitColis(arg0_in);

            _output = handler.createReply();

        }
        catch (ProjetCorba.TransporteurPackage.Tra_Inconnu _exception)
        {
            _output = handler.createExceptionReply();
            ProjetCorba.TransporteurPackage.Tra_InconnuHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_deposerColis(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg0_in = _is.read_short();

        try
        {
            deposerColis(arg0_in);

            _output = handler.createReply();

        }
        catch (ProjetCorba.TransporteurPackage.Tra_Inconnu _exception)
        {
            _output = handler.createExceptionReply();
            ProjetCorba.TransporteurPackage.Tra_InconnuHelper.write(_output,_exception);
        }
        catch (ProjetCorba.TransporteurPackage.Sta_Erreur _exception)
        {
            _output = handler.createExceptionReply();
            ProjetCorba.TransporteurPackage.Sta_ErreurHelper.write(_output,_exception);
        }
        catch (ProjetCorba.TransporteurPackage.Sta_Pleine _exception)
        {
            _output = handler.createExceptionReply();
            ProjetCorba.TransporteurPackage.Sta_PleineHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_selectionnerColisTra(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        try
        {
            selectionnerColisTra();

            _output = handler.createReply();

        }
        catch (ProjetCorba.TransporteurPackage.Col_Selec _exception)
        {
            _output = handler.createExceptionReply();
            ProjetCorba.TransporteurPackage.Col_SelecHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_payer(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        float arg0_in = _is.read_float();

        payer(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_transporterColis(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        transporterColis();

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_notifierTra(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();

        notifierTra(arg0_in);

        _output = handler.createReply();

        return _output;
    }

}
